Skip to content

config type target#3745

Open
plorenz wants to merge 8 commits intomainfrom
config-type-target
Open

config type target#3745
plorenz wants to merge 8 commits intomainfrom
config-type-target

Conversation

@plorenz
Copy link
Copy Markdown
Member

@plorenz plorenz commented Apr 2, 2026

  • Add a doc about potential anycast support for links
  • Add an initial doc exploring controller managed router configuration
  • Updated with review comments and additions regarding collapsing the router types
  • Update based on review feedback
  • More updates from review changes
  • Add a rough implementation plan
  • Add note on config permissions
  • Add target field to config types. Fixes Implement controller managed configuration for routers #3743

@plorenz plorenz requested review from a team as code owners April 2, 2026 20:50
@plorenz plorenz changed the title config type target [Ziti-2.1] config type target Apr 9, 2026
@plorenz plorenz changed the title [Ziti-2.1] config type target config type target Apr 9, 2026
@plorenz plorenz added this to the 2.1.0 milestone Apr 9, 2026
string name = 2;
bytes schema = 3;
map<string, TagValue> tags = 4;
optional string target = 5;
Copy link
Copy Markdown
Member

@andrewpmartinez andrewpmartinez Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why optional? I assume this is for backward compatibility, but optional makes string be *string and doesn't really do much else besides letting us detect whether it was explicitly set or not. I don't see a reason to detect whether a setting is set or not.

I assume that the default is a target value of "service," and we could create an enum that does this:

enum ConfigTargetType {
  CONFIG_TYPE_SERVICE = 0;
  CONFIG_TYPE_ROUTER = 1;
}

Then the config type can be the enum type and default cleanly to 0 and not have to deal w/ pointer refs.

Comment thread doc/design/anycast.md
Comment on lines +135 to +137
2. **Router data model.** Store fingerprints on the router data model and let them propagate
through the normal data model sync. Less chatty, since fingerprints only change on router
re-enrollment or cert rotation, not on every connect/disconnect.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd vote for RDM, there are other related changes that could be done, but don't solve this exact issue. They have trade-offs.

Comment thread doc/design/anycast.md
@@ -0,0 +1,226 @@
# Anycast Support for Router Links
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to include this on this PR? Seems out of place.

Comment thread ziti/cmd/edge/list.go
Comment on lines +1532 to +1539
t.AppendHeader(table.Row{"ID", "Name", "Target", "Schema"})

for _, entity := range children {
wrapper := api.Wrap(entity)
t.AppendRow(table.Row{
wrapper.String("id"),
wrapper.String("name"),
wrapper.String("target"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mismatched columns? 4 columns, only outputting 3 values?

},
Name: stringz.OrEmpty(configType.Name),
Name: stringz.OrEmpty(configType.Name),
Target: configType.Target,
Copy link
Copy Markdown
Member

@andrewpmartinez andrewpmartinez Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this optional in the API def, and it isn't defaulted here? Who uses NIL set target types? The API should be clear, but if backward compatibility is the goal, it seems reasonable to default to "service".

Comment on lines +77 to +86
configType, _ := configTypeStore.LoadById(tx, config.TypeId)
configTypeName := "<not found>"
if configType != nil {
configTypeName = configType.Name
if configType.Target == nil || *configType.Target != db.ConfigTypeTargetService {
msg := fmt.Sprintf("config %v has config type %v which does not target services",
config.Name, configTypeName)
return errorz.NewFieldError(msg, "configs", entity.Configs)
}
}
Copy link
Copy Markdown
Member

@andrewpmartinez andrewpmartinez Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if it is nil, we don't validate it? So we allow nil values and don't validate their target type?

Copy link
Copy Markdown
Member

@andrewpmartinez andrewpmartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think overall, the PRs dealing with target type for configs need more effort to default to 'service' for backward compatibility. Allowing nil values and such is just a recipe for disaster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement controller managed configuration for routers

2 participants